home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / wheels1.arc / GTSETDIR.LIB < prev    next >
Text File  |  1985-06-28  |  2KB  |  51 lines

  1. {@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
  2. The purchaser of these procedures and functions may include them in COMPILED
  3. programs freely, but may not sell or give away the source text.
  4.  
  5.       Any program that INCLUDES GtSetDir MUST include FILENAME.TYP
  6.       and REGPACK.TYP
  7.  
  8.       (This is in order to avoid multiple declarations)
  9. }
  10. {@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
  11. procedure GetSetDirectory(activity      : char;
  12.                           VAR drive     : char;
  13.                           VAR directory : filename_type;
  14.                           VAR error     : byte);
  15.  
  16. var
  17.   registers : regpack;
  18. begin
  19.   activity := upCase(activity);
  20.   with registers do
  21.     begin
  22.       case activity of
  23.         'G': begin
  24.                DX := ord(UpCase(drive))-64;
  25.                DS := seg(directory);
  26.                SI := ofs(directory)+1;
  27.                AX := $47 shl 8;
  28.              end;
  29.         'S': begin
  30.                directory[length(directory)+1] := #0;
  31.                DS := seg(directory);
  32.                DX := ofs(directory)+1;
  33.                AX := $3B shl 8;
  34.              end;
  35.       end; {case}
  36.       MSDOS(registers);
  37.       if Flags and 1 = 1 then
  38.         error := AX and $00FF
  39.       else
  40.         begin
  41.           error := 0;
  42.           if activity = 'G' then
  43.             begin
  44.               directory := copy(directory,1,pos(#0,directory)-1);
  45.               directory := drive + ':\' + directory;
  46.             end;
  47.         end;
  48.     end;  {with}
  49. end;
  50. {@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
  51.